package o;

import android.content.Context;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;
import com.huawei.appgallery.forum.posts.api.IPostDetailProtocol;
import o.bsy.d;

public class btq extends ClickableSpan implements btn {
    private Context ˊ;
    private String ˎ;
    private String ॱ;

    public btq(Context context, String str, String str2) {
        this.ˊ = context;
        this.ॱ = str;
        this.ˎ = str2;
    }

    public void onClick(View view) {
        ॱ();
        brd.ॱ.ˋ(bqy.ˋ().ˎ(), bqy.ˋ().ˎ(this.ˊ), this.ॱ);
    }

    public void updateDrawState(TextPaint textPaint) {
        textPaint.setColor(this.ˊ.getResources().getColor(d.ˏ));
    }

    private void ॱ() {
        fjb ˎ = fho.ˏ().ˋ("Posts").ˎ("post.detail.activity");
        IPostDetailProtocol iPostDetailProtocol = (IPostDetailProtocol) ˎ.ˊ();
        iPostDetailProtocol.setDomainId(bqy.ˋ().ˎ());
        iPostDetailProtocol.setUri(ˊ());
        fiu.ˊ().ˏ(this.ˊ, ˎ);
    }

    private String ˊ() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("forum|topic_detail|").append(this.ॱ);
        return stringBuilder.toString();
    }

    public String ˏ() {
        return this.ॱ;
    }

    public String ˎ() {
        return this.ˎ;
    }

    public String ॱ(String str, int i, int i2) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("[link=").append(ˎ()).append("_").append(ˏ()).append("]").append(str.substring(i + 3, i2)).append("[/link]");
        return stringBuilder.toString();
    }
}
